
Imports System.Data
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Framework.Providers
Imports DotNetNuke
Imports DotNetNuke.Modules.Wazzup.Components

Namespace Data

  ''' -----------------------------------------------------------------------------
  ''' <summary>
  ''' An abstract class for the data access layer
  ''' </summary>
  ''' <remarks>
  ''' </remarks>
  ''' <history>
  ''' </history>
  ''' -----------------------------------------------------------------------------
  Public MustInherit Class DataProvider

#Region "Shared/Static Methods"

    ' singleton reference to the instantiated object 
    Private Shared objProvider As DataProvider = Nothing

    ' constructor
    Shared Sub New()
      CreateProvider()
    End Sub

    ' dynamically create provider
    Private Shared Sub CreateProvider()
      objProvider = CType(Framework.Reflection.CreateObject("data", "DotNetNuke.Modules.Wazzup.Data", ""), DataProvider)
    End Sub

    ' return the provider
    Public Shared Shadows Function Instance() As DataProvider
      Return objProvider
    End Function

#End Region


#Region "Abstract methods"
    Public MustOverride Function GetLatestPosts(PortalID As Integer) As IDataReader

#End Region

  End Class

End Namespace